package com.itheima.demo02;

public class MainClass01 {
    public static void main(String[] args) {

        int i = 100;
        int sum = useMethod(i);
        System.out.println(sum);
    }

    private static int useMethod(int i) {
        if (i == 1) {
            return 1;
        } else {
            return i + useMethod(i - 1);
        }
    }
}
